package com.dongdongshop.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.dongdongshop.mapper.TbContentCategoryMapper;
import com.dongdongshop.pojo.TbContent;
import com.dongdongshop.pojo.TbContentCategory;
import com.dongdongshop.service.ContentCateGoryService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
@org.springframework.stereotype.Service
public class ContentCateGoryServiceImpl implements ContentCateGoryService {

    @Autowired
    private TbContentCategoryMapper tbContentCategoryMapper;

    @Override
    public List<TbContentCategory> contentCatGoryList(String name) {
        return tbContentCategoryMapper.contentCatGoryList(name);
    }

    @Override
    public Integer addContentCatGory(TbContentCategory tbContentCategory) {
        return tbContentCategoryMapper.insert(tbContentCategory);
    }

    @Override
    public TbContentCategory getContentCatGoryById(Long id) {
        return tbContentCategoryMapper.selectByPrimaryKey(id);
    }

    @Override
    public Integer updateContentCatGory(TbContentCategory tbContentCategory) {
        return tbContentCategoryMapper.updateByPrimaryKeySelective(tbContentCategory);
    }

    @Override
    public Integer deleteContentCatGory(Long[] id) {
        return tbContentCategoryMapper.deleteContentCatGory(id);
    }

}
